﻿#ifndef QTMBACKENDTASK_H
#define QTMBACKENDTASK_H

#include <QObject>
#include <QtCore>
#include <QDesktopWidget>

class QTmBackendTask;
class QTmThreadRepeat : public QThread
{
public:
    QTmThreadRepeat(QTmBackendTask* pTask);
    void setRepeatTime(int nDelay); // -1 closed, 0...

    void run();

protected:
    QTmBackendTask* m_pBackTask;
    int m_nDelayTime;
};


class QTmBackendTask : public QObject
{
    Q_OBJECT
public:
    explicit QTmBackendTask();

    bool init(QObject *rootObj);
    void proc_repeat_dir(int nDelay, QString strPath);
    void qml_repeat_show(QString strPath);
    void qml_ui_show_pic(int nDelay, QString strPath);
    void qml_ui_show_video(int nDelay, QString strPath,int nVolume);
    void qml_ui_show_barrage(QString strTxt, int nKeep);
    void qml_ui_show_clean();
    void qml_ui_show_vip(QString strPath,QString strName);
    void qml_ui_video_vip(int nType,QString strName);

private:
    QObject* pr_pObjRoot;

    //QTimer* m_pTMNotify;
//    QTimer* pr_tmRepeatWork;
    QStringList pr_picStrList;
    int pr_picIndex;

    // 屏幕管理
    QDesktopWidget* pr_pDesk;
    bool pr_bHaveExScreen;

    QTmThreadRepeat* pr_pThread;
public slots:
    void slot_tm_repeat();
    void slot_screenCountChanged(int newCount);

};

#endif // QTMBACKENDTASK_H
